package 面向对象_中.a继承;

/**
 * @Projectname java_based
 * @Filename Student
 * @Author an
 * @Data 2022/6/29 16:05
 * @Description TODO
 */

/*
 * 为描述和处理学生信息，定义类 Student
 */
public class Student extends Person {

    //	String name;
//	int age;
    String major;

    public Student(){

    }

    public Student(String name,int age,String major){
        this.name = name;
//		this.age = age;
        setAge(age);
        this.major = major;
    }

//	public void eat(){
//		System.out.println("吃饭");
//	}
//
//	public void sleep(){
//		System.out.println("睡觉");
//	}

    public void study(){
        System.out.println("学习");
    }

    public void show(){
        System.out.println("name:" + name + ",age = " + getAge());
    }

}
